package com.taotao.designpattern.chain;

/**
 *
 * @author fanbeibei
 * @version 1.0
 * @date 2021/1/5 11:14
 */
public class ChainClient {

    public static void main(String[] args) {
        ChainServer server = new ChainServer();
        server.addLast(new Handler() {
            @Override
            public Response handleRequest(Request request, ChainContext context) {
                System.out.println("---------"+request);
                return new Response("recv request!!");
            }
        });


        Response response = server.onRequest(new Request("a request"));
        System.out.println("-------------"+response);


    }
}
